using UnityEngine;

public class LightMan : Npc
{
    [Header("coll")]
    public GameObject collObj;
    private void Start()
    {
        collObj = transform.Find("CheckPosOne").gameObject;

        //隐藏
        collObj.GetComponent<Collider2D>().enabled = false;
    }
    private void OnMouseDown()
    {
        if (GameManager.Instance.canOprate==false) return;

        SceneItemManager.instance.clickEnemyRight = true;
        collObj.GetComponent<Collider2D>().enabled = true;
        SceneItemManager.instance.SetClickEnemy(gameObject);
    }
    //打开UI
    public void OpenLove()
    {
        Player player = GameManager.Instance.player;

        sayData.myName=npcName;
        sayData.type=SayType.Npc;
        sayData.player=player;
        if (!SceneItemManager.instance.GetNpcData(npcName))
        { 
            PanelManager.Open<SayPanel>(sayData);
        }
        else
        {
            //打开选择属性面板
            PanelManager.Open<LightManPanel>();
        }

        //关闭碰撞enable
        collObj.GetComponent<Collider2D>().enabled = false;
    }
}
